package linkage;

import hmm.Hmm;
import hmm.HmmException;
import hmm.MarkovModel;
import static java.lang.Math.pow;

public class LinkageMain {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		int[][] pedigree = {{-1,-1,0,1},
							{-1,-1,1,2},
							{0,1,1,2}};
		byte[][] loci = {	{1,1},
							{1,2},
							{1,2}};
		double[] markersDist = {};
		int numOfNonFounders = 1;
		Probabilities pr = new Probabilities(pedigree, loci, numOfNonFounders, markersDist);
		double[] pi = {1};
		
		try {
			// # of states || # of observation symbols || pr || pi || observation length
			MarkovModel model = new MarkovModel((int) pow(2, numOfNonFounders - 1), 2, pr, pi, loci[0].length / 2);
			Hmm hmm = new Hmm(model);
			double p = hmm.forwardAlgorithm();
			System.out.println(p);
		} catch (HmmException e) {
			e.printStackTrace();
		}
	}

}
